package com.area.cth.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Post implements Serializable {
    private Integer id;

    private Integer createUser;

    @NotEmpty
    @Pattern(regexp = "^\\S{1,32}$")
    private String title;

    @NotEmpty
    private String content;

    @URL
    private String img1;
    @URL
    private String img2;
    @URL
    private String img3;
    @URL
    private String img4;
    @URL
    private String img5;
    @URL
    private String img6;
    @URL
    private String img7;
    @URL
    private String img8;
    @URL
    private String img9;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private User user;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
